#ifndef TEMP_H
#define TEMP_H

#include <avr/pgmspace.h>
#include "Arduino.h"

#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal.h>
#include <EEPROM.h>

#include "utility.h";

// Data wire is plugged into port 10 on the Arduino
#define ONE_WIRE_BUS A13


const byte TEMP_NUMBER_OF_PROBES = 2;
extern PROGMEM const char *temp_probes_name_table[];

const byte TEMP_AQUARIUM_PROBE = 0;
const byte TEMP_WATER_CHANGE_PROBE = 1;

class Temp
{
public:
  void init();
  void update_temp();
  float get_temp(byte probe_num);
  char get_temp_calibration(byte probe_num);
  void set_temp_calibration(byte probe_num,char calibration);
  void print_temp(byte probe_num);
  void print_temp(byte probe_num,char calibration);
  void print_temp_without_calibration(byte probe_num);
  void print_temp_calibration(byte probe_num);

  void print_probe_name(byte probe_num);
  void print_probe_name_sort(byte probe_num);
  void print_temp(float temp);
  void print_temp(byte temp_h,byte temp_l);
  float get_temp(byte temp_h,byte temp_l);
private:
  float get_calibration(char calibration);
  
  bool ProbeFound[TEMP_NUMBER_OF_PROBES];
  
  float temp[TEMP_NUMBER_OF_PROBES];
  char   temp_calibration_b[TEMP_NUMBER_OF_PROBES];
  float temp_calibration[TEMP_NUMBER_OF_PROBES];

};


#endif


